/**
 * Created by Administrator on 2017/8/3.
 */
var express = require('express');
var router = express.Router();
var categoryController = require('../controllers/category');
var userController = require('../controllers/user');
var promise = require('../util/promise');

//category列表页
router.get('/list', userController.loginPermission, userController.adminPermission, promise(categoryController.list));
//category录入页
router.get('/add', userController.loginPermission, userController.adminPermission, promise(categoryController.add));
//category详情页
router.get('/detail/:id', userController.loginPermission, promise(categoryController.detail));
//category进行录入
router.post('/create', userController.loginPermission, userController.adminPermission, promise(categoryController.create));
//category进行删除
router.post('/del', userController.loginPermission, userController.adminPermission, promise(categoryController.del));
//category修改movies
router.post('/updateMovies', userController.loginPermission, userController.adminPermission, promise(categoryController.updateMovies));

module.exports = router;